package com.liao.badminton.dto;

import com.liao.badminton.code.BaseField;
import com.liao.badminton.code.validation.Delete;
import com.liao.badminton.code.validation.Insert;
import com.liao.badminton.code.validation.Update;
import com.liao.badminton.vo.ActivityParticipatorVo;
import io.swagger.annotations.ApiModelProperty;
import com.liao.badminton.entity.ActivityRecord;
import javax.validation.constraints.NotNull;
import java.util.List;
import lombok.Data;
import com.liao.badminton.code.validation.FindDetail;
import java.lang.String;
import java.math.BigDecimal;
import java.util.Date;

/**
* @author liaocheng
* @date 2024-11-15
* description:群发布活动记录表
*/
@Data
public class ActivityRecordDto extends BaseField {

    @ApiModelProperty(value = "id")
    @NotNull(message = "主键id不能为空",groups = {Update.class, FindDetail.class})
    private Long id;

    @ApiModelProperty(value = "群id")
    @NotNull(message = "群id不能为空",groups = {Insert.class})
    private Long groupId;

    @ApiModelProperty(value = "活动文本内容")
    @NotNull(message = "活动文本内容不能为空",groups = {Insert.class})
    private String txtContent;

    @ApiModelProperty(value = "参与人数:20")
    private Integer joinNum;

    @ApiModelProperty(value = "免费人数:10")
    private Integer FeeNum;

    @ApiModelProperty(value = "男生人数:10")
    private Integer maelNum;

    @ApiModelProperty(value = "女生人数:10")
    private Integer femaleNum;

    @ApiModelProperty(value = "全程男生人数:10")
    private Integer fullMaleNum;

    @ApiModelProperty(value = "全程女生人数:10")
    private Integer fullFemaleNum;

    @ApiModelProperty(value = "半程男生人数:10")
    private Integer halfMaleNum;

    @ApiModelProperty(value = "半程女生人数:10")
    private Integer halfFemaleNum;
    private Integer fullAbsentNum;  //飞机人数:10
    private Integer halfAbsentNum;  //半飞机人数:10
    @ApiModelProperty(value = "是否结算：0未结算，1已结算")
    private Integer settlementFlag;

    @ApiModelProperty(value = "总花费")
    private BigDecimal totalCost;
    private Integer collectType;  //收费方式：0均摊，1固定
    private BigDecimal fixedMale;  //男生固定价格
    private BigDecimal fixedFemale;  //女生固定价格
    private BigDecimal extraPerCost;  //额外每人：2玩
    private BigDecimal extraFixedCost;  //额外固定：组一场球收50
    @ApiModelProperty(value = "女生优惠价格5:不填就用群设置的")
    private BigDecimal femaleDiscountPrice;

    @ApiModelProperty(value = "场地数:2")
    private Integer siteNum;

    @ApiModelProperty(value = "场地价格/块/小时:80")
    private BigDecimal sitePerPrice;

    @ApiModelProperty(value = "场地总价:320")
    private BigDecimal siteTotalCost;
    @ApiModelProperty(value = "球总花费：0")
    private BigDecimal ballTotalCost;

    @ApiModelProperty(value = "时长:2.5")
    private BigDecimal timeLength;

    @ApiModelProperty(value = "使用球数:10")
    private Integer costBallNum;

    @ApiModelProperty(value = "每桶球数:12，不填就用群设置的")
    private Integer bucketBallNum;

    @ApiModelProperty(value = "每桶球价值:120，不填就用群设置的")
    private BigDecimal bucketPerPrice;


    @ApiModelProperty(value = "是否有效：0:无效，1:有效(导入统计)")
    private Integer validStatus;

    @ApiModelProperty(value = "参与人列表")
    List<ActivityParticipatorDto> activityParticipatorDtos;  //前端已经计算好费用了

    @NotNull(message = "主键id不能为空",groups = {Delete.class})
    private List<Long> delIds;  //批量删除ids

    public ActivityRecord invertEntity(){
        ActivityRecord dto = new ActivityRecord();
        BaseField.invert(this, dto);
        dto.setId(this.getId());
        dto.setGroupId(this.getGroupId());
        dto.setTxtContent(this.getTxtContent());
        dto.setJoinNum(this.getJoinNum());
        dto.setFeeNum(this.getFeeNum());
        dto.setFullMaleNum(this.getFullMaleNum());
        dto.setFullFemaleNum(this.getFullFemaleNum());
        dto.setHalfMaleNum(this.getHalfMaleNum());
        dto.setHalfFemaleNum(this.getHalfFemaleNum());
        dto.setFullAbsentNum(this.getFullAbsentNum());
        dto.setHalfAbsentNum(this.getHalfAbsentNum());
        dto.setSettlementFlag(this.getSettlementFlag());
        dto.setTotalCost(this.getTotalCost());
        dto.setCollectType(this.getCollectType());
        dto.setFixedMale(this.getFixedMale());
        dto.setFixedFemale(this.getFixedFemale());
        dto.setExtraPerCost(this.getExtraPerCost());
        dto.setExtraFixedCost(this.getExtraFixedCost());
        dto.setFemaleDiscountPrice(this.getFemaleDiscountPrice());
        dto.setSiteNum(this.getSiteNum());
        dto.setSitePerPrice(this.getSitePerPrice());
        dto.setSiteTotalCost(this.getSiteTotalCost());
        dto.setBallTotalCost(this.getBallTotalCost());
        dto.setTimeLength(this.getTimeLength());
        dto.setCostBallNum(this.getCostBallNum());
        dto.setBucketBallNum(this.getBucketBallNum());
        dto.setBucketPerPrice(this.getBucketPerPrice());
        dto.setValidStatus(this.getValidStatus());
        return dto;
    }
}
